﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Infraestruturex.Automata
{
    public class SequentialCharsTokenProvider : IBasicTokenProvider
    {
        #region ITokenProvider Members
        private string input;

        public string Input
        {
            get { return input; }
            set { input = value; Reset(); }
        }
        
        int current = 0;
        public void Reset()
        {
            current = 0;
        }

        public string PeekNextTokenClass()
        {
            return Input[current].ToString();
        }

        public void ConsumeNextToken()
        {
            current++;
        }

        public bool HasMoreTokens()
        {
            return current < Input.Length;
        }

        #endregion
    }
}
